/*
 * @Author: lokei
 * @Date: 2022-09-14 20:57:47
 * @LastEditors: lokei
 * @LastEditTime: 2022-10-23 21:00:05
 * @Description: 
 */
package cn.lokei.task.config.database;

import lombok.Data;

@Data
public class DatabaseInfo {
    String factoryCode;
    String url;
    String user;
    String password;

    public DatabaseInfo( String factoryCode, String username, String password ) {
        this.factoryCode = factoryCode;
        if(factoryCode != null && !factoryCode.equals("")) {
            this.url = "jdbc:mysql://127.0.0.1:3306/" + factoryCode + "_smartore?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8";
        } else {
            this.url = "jdbc:mysql://127.0.0.1:3306/smartore?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8";
        }
        this.user = username;
        this.password = password;
    }
}
